<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>练习display</title>
</head>
<body>
        <div class="demo01">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
            <div>6</div>
            <div>7</div>
            <div>8</div>
            <div>9</div>
            <div>10</div>
            <div>11</div>
            <div>12</div>
            <div>13</div>
            <div>14</div>
            <div>15</div>
            <div>16</div>
            <div>17</div>
            <div>18</div>
            <div>19</div>
            <div>20</div>
            <div>21</div>
        </div>
        <style>
            .demo01 {
                width: 650px;
        
            }
        
            .demo01 div {
                display: inline-block;
                width: 50px;
                height: 50px;
                margin: 10px 5px;
                border-radius: 50%;
                /* background: blue; */
                color: white;
                border: 2px solid red;
                text-align: center;
                line-height: 50px;
            }
        
            .demo01 div:nth-child(2n) {
                background: rgb(4, 4, 4);
            }
        
            .demo01 div:nth-child(2n+1) {
                background: blue;
            }
        </style>
</body>
</html>